public class OuterLoop {

    public static void main(String[] args) {
        //跳出外层循环
        OuterLoop:
        for (int i = 0; i < 5; i++) {
            System.out.println("--------------------------------------------------------------------------------i：" + i);
            for (int j = 0; j < 5; j++) {
                System.out.println("----------------------------------------------------------------------------j：" + j);
                if (i == 2 && j == 2) {
                    System.out.println("------------------------------------------------------i：" + i + "," + "j：" + j);
                    break OuterLoop;
                }
            }
        }
        System.out.println("------------------------------------------------------------------------------------------");
        for (int i = 0; i < 5; i++) {
            System.out.println("--------------------------------------------------------------------------------i：" + i);
            for (int j = 0; j < 5; j++) {
                System.out.println("----------------------------------------------------------------------------j：" + j);
                if (i == 2 && j == 2) {
                    System.out.println("------------------------------------------------------i：" + i + "," + "j：" + j);
                    return;
                }
            }
        }
    }

}
